//统一管理新闻动态相关的接口
import mockRequest from '@/utils/mockRequest'
import type { resNewData, newsDataType, resNewDetail } from './type'

//项目用户相关的请求地址
enum API {
    NEWS_URL = '/news',
    NEW_DETAIL_URL = '/newDetail',
    RECOMMEND_NEWS_URL = '/recommendNews'
}

// 获取新闻列表
export const reqGetNews = (data: newsDataType) => mockRequest.get<any, resNewData>(API.NEWS_URL, { data: data })

// 获取新闻详情信息
export const reqGetNewDetail = (id: number) => mockRequest.get<any, resNewDetail>(API.NEW_DETAIL_URL, { data: id })

// 获取推荐新闻列表
export const reqGetRecommendNews = () => mockRequest.get<any, resNewData>(API.RECOMMEND_NEWS_URL)